pub fn resolve_dependencies<'a>(ws: &Workspace<'a>,
source: Option<Box<Source + 'a>>,
- features: Vec<String>,
+ features: &[String],
all_features: bool,
no_default_features: bool,
spec: &'a [String])
-> CargoResult<(PackageSet<'a>, Resolve)> {
+ let features = features.iter().flat_map(|s| {
+ s.split_whitespace()
+ }).map(|s| s.to_string()).collect::<Vec<String>>();
let mut registry = try!(PackageRegistry::new(ws.config()));
ref target_rustc_args } = *options;
let target = target.map(|s| s.to_string());
- let features = features.iter().flat_map(|s| {
- s.split(' ')
- }).map(|s| s.to_string()).collect::<Vec<String>>();
if jobs == Some(0) {
bail!("jobs must be at least 1")
execs().with_status(101)
.with_stderr("[ERROR] metadata version 2 not supported, only 1 is currently supported"));
}
+
+#[test]
+fn multiple_features() {
+ let p = project("foo")
+ .file("Cargo.toml", r#"
+ [package]
+ name = "foo"
+ version = "0.1.0"
+ authors = []
+
+ [features]
+ a = []
+ b = []
+ "#)
+ .file("src/lib.rs", "");
+
+ assert_that(p.cargo_process("metadata")
+ .arg("--features").arg("a b"),
+ execs().with_status(0));
+}